<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>奇思妙想</title>

    <style>
        .clearfix::before,.clearfix::after{
             content: "";
             display: table;
             clear: both;
        }
       

        .fl{
            width: 200px;
            height: 200px;
            float: left;
            margin-right: 10px;

        }

        .box{
            background-color: cornflowerblue;
            /* overflow: hidden;   子元素的子元素如果绝对定位溢出之后会被裁剪,所以放置浮动产生的问题还是得使用clearfix
            
            
            */
        }

        .box1{
            background-color: aquamarine;
        }
        .box2{
            background-color: blueviolet;
        }
        .box3{
            background-color: brown;
        }
        .box4{
            background-color: chocolate;
            position: relative;
        }

        .demo{
            position:absolute;
            width: 100px;
            height: 100px;
            background-color: darkblue;
            top:200px;
            
           
        }
    </style>
</head>
<body>
    <div class="box clearfix">
        <div class="box1 fl"></div>
        <div class="box2 fl"></div>
        <div class="box3 fl"></div>
        <div class="box4 fl">
            <div class="demo">11111</div>
        </div>
    </div>
   
</body>
</html>